Skip to content

The catalog Discuss button never worked - #599

Merged
mrviduus merged 1 commit into
mainfrom
fix/catalog-handoff-slug
Sep 10, 2026
Merged

The catalog Discuss button never worked#599
mrviduus merged 1 commit into
mainfrom
fix/catalog-handoff-slug

Conversation

@mrviduus

Copy link
Copy Markdown
Owner

The brief handed the assistant an editionId and told it to call get_book and
get_chapter. Both are keyed by slug, with additionalProperties: false — so
every call made from that brief was rejected. The button has been shipping in
that state since it was written, which is part of why zero conclusions ever came
back.

The fix

A catalog book needs both identifiers, because the tools disagree about which
one they take:

Tool Keyed by
get_book, get_chapter slug
save_insight, get_my_insights editionId (or bookId, XOR, by book type)

The brief now carries both and says which is for what. With only one of the pair
it says nothing about the connector at all — half the pair is worse than none,
because it names tools it cannot satisfy.

Uploads are unchanged: one id addresses everything.

Its test could not have caught this

The old assertion was that the brief string contained the substring get_book
— prose checked against prose. It passed happily while the brief named a tool it
was feeding the wrong identifier.

Replaced with a table of which identifier each tool accepts, mirroring the JSON
schemas in McpToolCatalog, plus an assertion that the brief never names a tool
without carrying an identifier that tool takes. Writing the table caught my own
error in it
: the insight tools accept either id, XOR, not editionId only.

Same two call sites, second fix

Both catalog screens already compute where the reader stopped — the Continue
Reading button above the Discuss button is built from it — and handed the
assistant none of it. They now pass the chapter title, and mobile the progress
fraction as well. That closes one of the carry-forward items in
assistant-handoff.md.

Verified

698 web, 369 mobile, 12 shared tests; tsc clean on web and mobile.

🤖 Generated with Claude Code

https://claude.ai/code/session_011rgEMvYYi4Egj99dVtvm6E

It handed the assistant an `editionId` and told it to call `get_book` and
`get_chapter` — both of which are keyed by `slug` with
`additionalProperties: false`, so every call made from that brief was rejected.
The button has been shipping in that state since it was written.

A catalog book needs BOTH identifiers, because the tools disagree about which one
they take: the read tools are slug-keyed, `save_insight` and `get_my_insights` are
editionId-keyed. The brief now carries both and says which is for what. With only
one of the pair it says nothing about the connector at all — half the pair is
worse than none, because it names tools it cannot satisfy.

Its test could not have caught this: it asserted the brief *string* contained the
substring "get_book", which is prose checked against prose. Replaced with a table
of which identifier each tool accepts — mirroring the JSON schemas in
McpToolCatalog — and an assertion that the brief never names a tool without
carrying an identifier that tool takes. Writing that table caught my own error in
it: the insight tools take either id, XOR, not editionId only.

Same two call sites also stopped throwing away what they already knew. Both
catalog screens compute the reader's position for their own Continue Reading
button and handed the assistant none of it; they now pass the chapter title, and
mobile the progress fraction as well.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011rgEMvYYi4Egj99dVtvm6E
@mrviduus
mrviduus merged commit 298a5d7 into main Sep 10, 2026
10 checks passed
@mrviduus
mrviduus deleted the fix/catalog-handoff-slug branch September 10, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant